package icasue.tools.sqlhelper.core.providers;

import icasue.reflect.annotations.NotNull;
import icasue.tools.sqlhelper.core.Consult;

/**
 * @Author: Qiao Hang
 * @CreateDate: 2021/11/18 下午4:34
 * @UpdateDate:
 * @Description:
 */
public interface CountSqlProvider<JavaType extends Object> {
    /**
     * 查询数据库总记录数.
     * @return
     * @throws Throwable
     */
    String countAll() throws Throwable;

    /**
     * 查询实例属性不为null的数据库记录数.
     * @param inst
     * @throws Throwable
     */
    String countSmart(@NotNull JavaType inst) throws Throwable;

    /**
     * 通过咨询查询数据库记录数.
     * @throws Throwable
     */
    String countByConsult(@NotNull Consult<JavaType> consult) throws Throwable;
}
